/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ai;

import ai.gui.Image;
import java.awt.Dimension;
import java.util.Observable;
import java.util.Random;
import java.util.Vector;
import uk.ac.bath.util.Tweakable;

/**
 *
 * @author pjl
 */
public abstract class AbstractBrain extends Observable implements Brain {

    protected Vector<Image> imagination;
    protected Vector<Tweakable> tweaks;
    protected Result result;
    protected Dimension dPixel;
    protected Dimension dLabel;
    protected int nPixel;
    protected int nLabel;
    protected Random rand = Util.createRandom();
    private String name;

    protected AbstractBrain(Dimension dIn, Dimension dOut, String name) {
        this.dPixel = dIn;
        this.dLabel = dOut;
        nPixel = dIn.width * dIn.height;
        nLabel = dOut.width * dOut.height;
        result = new Result(dIn, dOut);
        tweaks = new Vector<Tweakable>();
        imagination = new Vector<Image>();
        this.name = name;
    }

    public int getImaginationCount() {
        return imagination.size();
    }

    public Image getImagination(int i) {
        return imagination.get(i);
    }

    public Vector<Tweakable> getTweaks() {
        return tweaks;
    }

    public String getName() {
        return name;
    }

    public void addImage(Image image) {
        imagination.add(image);
    }

    public Random getRandom() {
        return rand;
    }
}
